package com.suny.City;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 基础表-省市区
 * @TableName city
 */
//@Schema(description = "省县区实体")
@TableName(value ="city")
@Data
@Accessors(chain = true)
public class City implements Serializable {
    /**
     * ID
     */
    @JsonIgnore
    @Schema(name = "id", description = "主键")
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 创建时间
     */
    @JsonIgnore
    @Schema(name = "createTime", description = "创建时间")
    private Date createTime;

    /**
     * 更新时间
     */
    @JsonIgnore
    @Schema(name = "updateTime", description = "更新时间")
    private Date updateTime;

    /**
     * 名称
     */
    @Schema(name = "name", description = "名称")
    private String name;

    /**
     * 区域编号
     */
    @JsonIgnore
    @Schema(name = "code", description = "区域编号")
    private String code;

    /**
     * 层级 1,2,3
     */
    @JsonIgnore
    @Schema(name = "level", description = "层级 1,2,3")
    private Integer level;

    /**
     * 父级ID
     */
    @JsonIgnore
    @Schema(name = "parentId", description = "父级ID")
    private Integer parentId;

    /**
     * 拼音首字母缩写
     */
    @JsonIgnore
    @Schema(name = "acronym", description = "拼音首字母缩写")
    private String acronym;

    /**
     * 排序
     */
    @JsonIgnore
    @Schema(name = "sort", description = "排序")
    private Integer sort;
    /*
     * 子城市列表
     */
    @Schema(name = "children", description = "子城市列表")
    @TableField(exist = false)
    private List<City> children;

}